GXGetDeviceStatus
QuickDraw GX sends theGXGetDeviceStatus
message to query the device about its status. You can override theGXGetDeviceStatus
message to send a query to your own device about its status. Your override of theGXGetDeviceStatus
message must match the following formal declaration:
OSErr MyGetDeviceStatus (Ptr cmdData, long cmdSize, Ptr responseData, long *responseSize, Str255 termination);
cmdData
- A pointer to the status query command data.
cmdSize
- The number of bytes in the command data.
responseData
- On return, a pointer to the data that contains the device's response.
responseSize
- On entry, the number of bytes to read. On return, the number of bytes in the response data.
termination
- This is the string that marks the end of the response in the
responseData
parameter. If this isnil
, you need to read all of the bytes in the response data.- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
Before sending theGXGetDeviceStatus
message yourself, you need to make sure that all pending I/O with your device is flushed. This can be done by sending aGXWriteData
message with anil
pointer and a length of 0.The default implementation of this message supports PAP, serial, and not-connected communications by writing a status request and reading back the result from the device.
SPECIAL CONSIDERATIONS
You can send theGXGetDeviceStatus
message when you want to perform a status check of a device.If you are implementing a nonsupported type of communications connection, you need to perform a total override of the
GXGetDeviceStatus
message. Otherwise, you need to perform your tasks and then forward the message.RESULT CODES
The default implementation of the
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. GXGetDeviceStatus
message can also return the communications errors that are listed in Table 4-2 on page 4-42.SEE ALSO
TheGXWriteData
message is described on page 4-141.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help